package queue

//使用别名方式拓展
// 任何类型：interface{}

type QueueInterface []interface{}

func (q *QueueInterface) Push(v interface{}) {
	*q = append(*q, v)
}

func (q *QueueInterface) PopLeft() interface{} {
	head := (*q)[0]
	*q = (*q)[1:]
	return head
}

func (q *QueueInterface) Pop() interface{} {
	tail := (*q)[len(*q)-1]
	*q = (*q)[:len(*q)-1]
	return tail
}

func (q *QueueInterface) IsEmpty() bool {
	return len(*q) == 0
}
